package com.glorysoft.hlgdpda.ui.setting.view

import android.os.Bundle
import android.view.View
import com.glorysoft.hlgdpda.R
import com.glorysoft.hlgdpda.BR
import com.glorysoft.hlgdpda.base.BaseActivity
import com.glorysoft.hlgdpda.databinding.ActivitySettingBinding
import com.glorysoft.hlgdpda.ui.setting.viewmodel.SettingViewModel
import kotlinx.android.synthetic.main.activity_setting.*

/**
 * FileName: SettingActivity
 * Author: XJH
 * Date: 2021/5/13 14:40
 * Description:
 * History:
 */
class SettingActivity : BaseActivity<SettingViewModel, ActivitySettingBinding>(), View.OnClickListener {
    override fun layoutId(): Int {
        return R.layout.activity_setting
    }

    override fun initVariableId(): Int {
        return BR.settingViewModel
    }

    override fun initData() {
        rlIP.setOnClickListener(this)
        rlFileIP.setOnClickListener(this)
    }

    override fun initView(savedInstanceState: Bundle?) {
        viewModel.initVersion(this)
    }

    override fun onClick(p0: View?) {
        when(p0?.id){
            R.id.rlIP -> viewModel.showScanDialog(this,0)
            R.id.rlFileIP -> viewModel.showScanDialog(this,1)
        }
    }
}